const express = require('express');
const router = express.Router();

const youdaoService = require('../service/youdaoService');

router.use('/youdao', function (req, res, next) {
    const q = req.query.q || req.body.q;
    youdaoService.fanyi(q, function (err, result) {
        res.send(err || result);
    });
});

module.exports = router;